package com.test.burnincash.activity_fragment_burnin;

import android.os.Bundle;

import com.test.burnincash.util_burnin.StringUtil_burnin;
import com.test.burnincash.util_burnin.http_burnin.HttpManager_burnin;
import com.test.burnincash.R;
import com.test.burnincash.activity_fragment_burnin.base_burnin.BaseActivity_burnin;
import com.test.burnincash.activity_fragment_burnin.base_burnin.BaseApplication_burnin;
import com.test.burnincash.activity_fragment_burnin.login_burnin.LoginPhoneNumActivity_burnin;
import com.test.burnincash.util_burnin.analytics_burnin.util_burnin.AnalyticsUtil_burnin;

public class MainActivity_burnin extends BaseActivity_burnin {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_burnin);
        init();
    }

    private void init() {

        findViewById(R.id.activity_main_layout_login).setOnClickListener(v -> HttpManager_burnin.getInstance().getAppShowInfo());

        StringUtil_burnin.parseAddress(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        //获取配置
        HttpManager_burnin.getInstance().getAppShowInfo();
    }

    //查询配置信息响应
    public void onAppShowInfoResponse() {
        //每次启动，等全局配置接口返回成功后，初始化分析模块
        try {
            AnalyticsUtil_burnin.INSTANCE.init(BaseApplication_burnin.getApplication_burnin());
        } catch (Exception e) {
            e.printStackTrace();
        }

        //跳转登录页
        startActivityForSingleTop_burnin(LoginPhoneNumActivity_burnin.class);
    }
}